package com.gm.wholesale.module.evenbus;

import com.gm.commonlib.module.evenbus.EventBusUtils;
import com.gm.commonlib.module.evenbus.EventMessage;
import com.gm.wholesale.bluetooth.bean.DeviceBean;
import com.gm.wholesale.module.custom.bean.CustomBean;
import com.gm.wholesale.module.good.bean.GoodListBean;
import com.gm.wholesale.module.order.bean.OrderBean;
import com.gm.wholesale.module.order.bean.OrderDetailBean;
import com.gm.wholesale.module.order.bean.needorder.NeedOrderBean;
import com.gm.wholesale.module.settlement.bean.custorm.CustormReviceBean;

public class EvenBusUtil {
    //更新主界面客户信息
    public static void updateHomeDefaultCustorm(CustomBean customBean) {
        EventBusUtils.post(new EventMessage(EventBusType.SHOW_DEFAULT_CUSTORM.getType(), customBean));
    }

    //清空订单列表数据
    public static void clearnHomeOrder() {
        EventBusUtils.post(new EventMessage(EventBusType.CLERAN_ORDER.getType()));
    }

    //更新订单详情界面
    public static void updateOrderDetail(OrderBean orderBean) {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_ORDER_DETAIL.getType(), orderBean));
    }

    //更新商品分类
    public static void updateGoodKind() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_KIND.getType()));
    }

    //设置调用连接蓝牙秤
    public static void connectionWeightBlue(DeviceBean deviceBean) {
        EventBusUtils.post(new EventMessage(EventBusType.CONNECTION_DEVICE.getType(), deviceBean));
    }


    //连接蓝牙称成功
    public static void connectionSuccess() {
        EventBusUtils.post(new EventMessage(EventBusType.CONNECTION_DEVICE_SUCCESS.getType()));
    }

    //连接失败
    public static void connectionFail() {
        EventBusUtils.post(new EventMessage(EventBusType.CONNECTION_DEVICE_FAIL.getType()));
    }


    //显示售后界面
    public static void showAfterSale(OrderDetailBean data) {
        EventBusUtils.post(new EventMessage(EventBusType.TO_AFTERSALEVIEW.getType(), data));
    }


    //显示需求单子详情
    public static void showNeedOrderDetail(NeedOrderBean needOrderBean) {
        EventBusUtils.post(new EventMessage(EventBusType.SHOW_NEED_ORDER_DETAIL.getType(), needOrderBean));
    }

    //修改需求单列表里面某个item的状态
    public static void updateNeedOrderListItem(NeedOrderBean needOrderBean) {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_NEED_ORDER_LIST_ITEM.getType(), needOrderBean));
    }

    //修改订单
    public static void updateOrder(OrderDetailBean orderDetailBean) {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_ORDER.getType(), orderDetailBean));
    }


    //回执成功，修改需求单详情和列表
    public static void updateNeedOrderByReceipt(NeedOrderBean needOrderBean) {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_NEED_ORDER_DETAIL.getType(), needOrderBean));
    }

    //todo  更新订单列表界面
    public static void updateOrderMangerList(OrderDetailBean orderDetailBean) {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_ORDER_LIST.getType(), orderDetailBean));
    }


    //打印了需求单子,更新需求单状态
    public static void updateNeedOrderByPrint() {
        EventBusUtils.post(new EventMessage(EventBusType.IS_PRINT.getType()));
    }




    //关闭对账单事件
    public static void closeSettleMentOrderDetail() {
        EventBusUtils.post(new EventMessage(EventBusType.FINISH_SETTLEMENT_DETAIL.getType()));
    }


    //更新应收账款左边客户列表界面

    public static void updateSettlemenList() {

        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_CUSTORM_LIST.getType()));
    }

    //应收对账，点击客户列表显示对应得 对账信息
    public static void showCustormSettlementDetail(CustormReviceBean custormReviceBean) {
        EventBusUtils.post(new EventMessage(EventBusType.SHOW_CUSTORM_SETTLEMENT.getType(), custormReviceBean));
    }

    //修改了订单名字需要刷新，支付了需要刷新
    public static void updateWaittoAccuntList() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_WAITTOACCUNTLIST.getType()));
    }

    //取消订单
    public static void cancelDZOrder() {
        EventBusUtils.post(new EventMessage(EventBusType.CANCLE_DZ_ORDER.getType()));
    }


    //创建商品 或者修改商品(goodListBean 为空创建，否则修改)
    public static void showCreateGoodUI(GoodListBean goodListBean) {
        EventBusUtils.post(new EventMessage(EventBusType.CREATE_GOOD.getType(), goodListBean));
    }

    //修改商品后，更新对应分类得商品数据
    public static void updateOneKindGoodList() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_ONE_KIND_GOOD.getType()));
    }

    //新增商品后，更新商品列表和 主界面商品列表（包括分类都要更新）
    public static void updateAllGoodList() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_GOOD_LIST.getType()));
    }

    //支付详情支付后，更新支付列表界面
    public static void updatePayTabList() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_PAY_TAB_LIST.getType()));
    }


    //创建客户 或者修改客户(CustomBean 为空创建，否则修改)
    public static void showCreateCustormUI(CustomBean customBean) {
        EventBusUtils.post(new EventMessage(EventBusType.CREATE_CUSTORM.getType(), customBean));
    }


    //刷新客户列表
    public static void updateCustormList() {
        EventBusUtils.post(new EventMessage(EventBusType.UPDATE_CUSTORM_MANGER_LIST.getType()));
    }


}
